<form action="{% url 'polls:vote' question.id %}" method="post" class="vote-form">
    {% csrf_token %}
    <div class="vote-card">
        <h1 class="vote-question">{{ question.question_text }}</h1>
        
        {% if error_message %}
        <div class="error-message" role="alert">
            <i class="fas fa-exclamation-circle"></i>
            <strong>{{ error_message }}</strong>
        </div>
        {% endif %}
        
        <div class="vote-options">
            {% for choice in question.choice_set.all %}
            <label for="choice{{ forloop.counter }}" class="vote-option">
                <input 
                    type="radio" 
                    name="choice" 
                    id="choice{{ forloop.counter }}" 
                    value="{{ choice.id }}"
                    class="vote-radio"
                    {% if forloop.first %}autofocus{% endif %}
                >
                <span class="custom-radio"></span>
                <span class="option-text">{{ choice.choice_text }}</span>
            </label>
            {% endfor %}
        </div>
        
        <button type="submit" class="vote-button">
            <i class="fas fa-paper-plane"></i>
            <span>提交投票</span>
        </button>
    </div>
    
    <style>
        :root {
            --primary: #4361ee;
            --primary-dark: #3a0ca3;
            --secondary: #4895ef;
            --danger: #f72585;
            --success: #4cc9f0;
            --warning: #f8961e;
            --light: #f8f9fa;
            --dark: #212529;
            --gray: #adb5bd;
            --border-radius: 12px;
            --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
        }
        
        .vote-card {
            background: #fff;
            border-radius: var(--border-radius);
            box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
            padding: 2.5rem;
            max-width: 600px;
            margin: 2rem auto;
            font-family: 'Segoe UI', 'Noto Sans SC', sans-serif;
            border: 1px solid rgba(0, 0, 0, 0.05);
            transition: var(--transition);
        }
        
        .vote-card:hover {
            box-shadow: 0 15px 35px rgba(0, 0, 0, 0.12);
            transform: translateY(-2px);
        }
        
        .vote-question {
            color: var(--dark);
            margin-bottom: 2rem;
            font-size: 1.8rem;
            font-weight: 600;
            text-align: center;
            line-height: 1.4;
            position: relative;
            padding-bottom: 1rem;
        }
        
        .vote-question::after {
            content: '';
            position: absolute;
            bottom: 0;
            left: 50%;
            transform: translateX(-50%);
            width: 80px;
            height: 4px;
            background: linear-gradient(to right, var(--primary), var(--secondary));
            border-radius: 2px;
        }
        
        .error-message {
            color: var(--danger);
            background: rgba(247, 37, 133, 0.1);
            padding: 1rem;
            border-radius: 8px;
            margin-bottom: 1.5rem;
            display: flex;
            align-items: center;
            gap: 0.75rem;
            border-left: 4px solid var(--danger);
            animation: shake 0.5s ease;
        }
        
        .error-message i {
            font-size: 1.2rem;
        }
        
        .vote-options {
            display: flex;
            flex-direction: column;
            gap: 1rem;
            margin-bottom: 2.5rem;
        }
        
        .vote-option {
            display: flex;
            align-items: center;
            gap: 1rem;
            padding: 1.25rem 1.5rem;
            border-radius: var(--border-radius);
            background: var(--light);
            cursor: pointer;
            transition: var(--transition);
            position: relative;
            overflow: hidden;
            border: 1px solid rgba(0, 0, 0, 0.05);
        }
        
        .vote-option:hover {
            background: rgba(67, 97, 238, 0.05);
            transform: translateX(5px);
        }
        
        .vote-option::before {
            content: '';
            position: absolute;
            left: 0;
            top: 0;
            height: 100%;
            width: 0;
            background: linear-gradient(to bottom, var(--primary), var(--secondary));
            transition: var(--transition);
            opacity: 0.1;
        }
        
        .vote-option:hover::before {
            width: 5px;
        }
        
        .vote-radio {
            position: absolute;
            opacity: 0;
        }
        
        .custom-radio {
            width: 1.5rem;
            height: 1.5rem;
            border: 2px solid var(--gray);
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: var(--transition);
            flex-shrink: 0;
        }
        
        .custom-radio::after {
            content: '';
            width: 0.8rem;
            height: 0.8rem;
            background: white;
            border-radius: 50%;
            transform: scale(0);
            transition: var(--transition);
        }
        
        .vote-radio:checked + .custom-radio {
            background: var(--primary);
            border-color: var(--primary);
        }
        
        .vote-radio:checked + .custom-radio::after {
            transform: scale(1);
        }
        
        .vote-radio:focus-visible + .custom-radio {
            box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.3);
        }
        
        .option-text {
            font-size: 1.1rem;
            font-weight: 500;
            color: var(--dark);
            transition: var(--transition);
        }
        
        .vote-radio:checked ~ .option-text {
            color: var(--primary);
        }
        
        .vote-button {
            background: linear-gradient(to right, var(--primary), var(--secondary));
            color: white;
            border: none;
            padding: 1rem 2rem;
            font-size: 1.1rem;
            border-radius: var(--border-radius);
            cursor: pointer;
            transition: var(--transition);
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 0.75rem;
            width: 100%;
            font-weight: 600;
            box-shadow: 0 4px 15px rgba(67, 97, 238, 0.3);
        }
        
        .vote-button:hover {
            transform: translateY(-2px);
            box-shadow: 0 8px 20px rgba(67, 97, 238, 0.4);
        }
        
        .vote-button:active {
            transform: translateY(0);
        }
        
        .vote-button i {
            transition: var(--transition);
        }
        
        .vote-button:hover i {
            transform: translateX(3px);
        }
        
        /* 动画效果 */
        @keyframes shake {
            0%, 100% { transform: translateX(0); }
            20%, 60% { transform: translateX(-5px); }
            40%, 80% { transform: translateX(5px); }
        }
        
        @keyframes fadeIn {
            from { opacity: 0; transform: translateY(10px); }
            to { opacity: 1; transform: translateY(0); }
        }
        
        .vote-option {
            animation: fadeIn 0.5s ease-out;
            animation-fill-mode: both;
        }
        
        .vote-option:nth-child(1) { animation-delay: 0.1s; }
        .vote-option:nth-child(2) { animation-delay: 0.2s; }
        .vote-option:nth-child(3) { animation-delay: 0.3s; }
        .vote-option:nth-child(4) { animation-delay: 0.4s; }
        .vote-option:nth-child(5) { animation-delay: 0.5s; }
        
        /* 响应式设计 */
        @media (max-width: 768px) {
            .vote-card {
                padding: 1.75rem;
            }
            
            .vote-question {
                font-size: 1.5rem;
            }
            
            .vote-option {
                padding: 1rem;
            }
        }
        
        @media (max-width: 480px) {
            .vote-card {
                padding: 1.5rem;
                margin: 1rem auto;
            }
            
            .vote-question {
                font-size: 1.3rem;
            }
            
            .option-text {
                font-size: 1rem;
            }
            
            .vote-button {
                padding: 0.9rem;
                font-size: 1rem;
            }
        }
    </style>
    
    <!-- 引入Font Awesome -->
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
